import { createAward,updateAwardDeclare,findMyDeclareList, findAwardTableTemplate, findAwardList ,findAwardOne 
    ,updateAward, deleteAward, findAwardTableList,findAwardDeclareOne,auditAwardDeclare,auditAwardDeclareList} from '@/api/awardManager'

const awardManager = {
    actions: {
        // 创建
        CreateAward({ commit }, data) {
            return new Promise((resolve, reject) => {
                createAward(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        // 修改奖项
        UpdateAward({ commit }, data) {
            return new Promise((resolve, reject) => {
                updateAward(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        // 删除奖项
        DeleteAward({ commit }, data) {
            return new Promise((resolve, reject) => {
                deleteAward(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },


        // 查询表单模板
        FindAwardTableTemplate({ commit }) {
            return new Promise((resolve, reject) => {
                findAwardTableTemplate().then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        //奖项查询
        FindAwardList({ commit }, data) {
            return new Promise((resolve, reject) => {
                findAwardList(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        //奖项单个查询
        FindAwardOne({ commit }, data) {
            return new Promise((resolve, reject) => {
                findAwardOne(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        //奖项申请表单查询list
        FindAwardTableList({ commit }, data) {
            return new Promise((resolve, reject) => {
                findAwardTableList(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        
        //奖项申请表查询
        FindAwardDeclareOne({ commit }, data) {
            return new Promise((resolve, reject) => {
                findAwardDeclareOne(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

         //奖项申请表修改
         UpdateAwardDeclare({ commit }, data) {
            return new Promise((resolve, reject) => {
                updateAwardDeclare(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        //我的奖项申请查询
        FindMyDeclareList({ commit }, data) {
            return new Promise((resolve, reject) => {
                findMyDeclareList(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

         //审核奖项申报
         AuditAwardDeclare({ commit }, data) {
            return new Promise((resolve, reject) => {
                auditAwardDeclare(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

         //我的奖项申请查询
         AuditAwardDeclareList({ commit }, data) {
            return new Promise((resolve, reject) => {
                auditAwardDeclareList(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },



    }
}

export default awardManager
